﻿using System;
using System.Collections.Generic;
using System.Text;

namespace SpEasyClasses
{
    public class ChannelFactory
    {
        private static Int16 lastChannelId = 0;
        private static List<Channel> channels = new List<Channel>();

        public static Channel CreateChannel(String name)
        {
            return CreateChannel(name, "", "");
        }

        public static Channel CreateChannel(String name, String password)
        {
            return CreateChannel(name, "", password);
        }

        public static Channel CreateChannel(String name, String desc, String password)
        {
            channels.Add(new Channel(lastChannelId, name, desc, password));

            return channels[lastChannelId++];
        }

        public static Channel GetChannelById(Int16 id)
        {
            return channels[id];
        }
    }
}
